package com.dstz.demo.rest.controller;

import com.alibaba.fastjson.JSONObject;
import com.dstz.base.api.aop.annotion.CatchErr;
import com.dstz.base.api.response.impl.ResultMsg;
import com.dstz.base.rest.BaseController;
import com.dstz.demo.core.manager.BudgetImportManager;
import com.dstz.demo.core.manager.impl.ImportDataManagerImpl;
import com.dstz.demo.core.model.BudgetImport;
import com.dstz.demo.core.model.ImportData;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/sys/budgetimport")
public class BudgetImportController extends BaseController<BudgetImport> {
    @Resource
    BudgetImportManager budgetImportManager;
    @Resource
    ImportDataManagerImpl importDataManager;


    @Override
    protected String getModelDesc() {
        return null;
    }

    @PostMapping("/save")
    @CatchErr(write2response = true,value = "查询信息失败")
    public ResultMsg save(HttpServletRequest request){
        JSONObject jsonObject1= JSONObject.parseObject(request.getParameter("json"));
        System.out.println(jsonObject1);
//        System.out.println(123123);
        ImportData importData=new ImportData();
//        importDataManager.importsave(importData);
//        budgetImportManager.save(budgetImport);
        return getSuccessResult("提交成功,正在处理");
    }
}
